<template>
  <div class="login">

    <h3>登录界面</h3>
    <div v-if="loading">读取中...</div>
    <div v-else>{{ content }}</div>
  </div>
</template>

<script>
export default {
  name: "Login",
  data: () => {
    return {
      loading: false,
      content: '',
    }
  },
  created() {
    this.init();
  },
  methods: {
    init (){
      console.log(this);
      this.loading = true;
      setTimeout(()=>{
        this.content = "经过交互返回来的数据"
      },1500);
      this.loading = false;
    }
  }
}
</script>

<style scoped>
.login {
  margin: 5% 30%;
  padding: 2%;
}
</style>